/**
 * Copyright (C), 2015-2020, XXX有限公司
 * FileName: Student
 * Author:   AEO WUGUOZHI
 * Date:     2020/7/20 21:52
 * Description: 学生类
 * History:
 * <author>          <time>          <version>          <desc>
 * 作者姓名           修改时间           版本号              描述
 */
package collection;

import java.util.HashSet;
import java.util.Objects;
import java.util.Set;

/**
 * 〈一句话功能简述〉<br> 
 * 〈学生类〉
 *
 * @author AEO WUGUOZHI
 * @create 2020/7/20
 * @since 1.0.0
 */
public class Student {
    private String id;
    public String name;
    public Set<Course> courses;

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Student(String id, String name) {
        this.id = id;
        this.name = name;
        this.courses = new HashSet<Course>();
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Student student = (Student) o;
        return name.equals(student.name);
    }

    @Override
    public int hashCode() {
        return Objects.hash(name);
    }

    public Student(){
        this.courses = new HashSet<Course>();
    }


}